Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request for crawler #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jitendravarma
Copy link
Collaborator

Added crawler to cache Scrapy responses in crawler/services. This generic crawler will write all html response to disk.

Copy link
Collaborator

@sidharthshah sidharthshah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor fixes, once this is done please submit a PR

@@ -0,0 +1,39 @@
import os
from hashlib import md5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should possibly be called utils.py


from scrapy_ft_jobs_sites.settings import CRAWLER_DIR

MAX_HASH_CHARS = 8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to settings.py

@@ -37,10 +37,13 @@ def __init__(self, *args, **kwargs):
self.start_urls.append(URL)

for pagination in range(10, 60, 10):
URL = self.base_url_pattern + item.replace(" ", "+") + "&start=" + str(pagination)
URL = self.base_url_pattern + \
item.replace(" ", "+") + "&start=" + str(pagination)
self.start_urls.append(URL)

def parse_item(self, response):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you have test case for parsing logic, this will help making sure our standard is enforced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants